import requests
def face_analyze(API_key,API_sercret,image_path):
    """该函数为调用face++ face_analyze接口"""
    base_url = 'https://api-cn.faceplusplus.com/facepp/v3/face/analyze'
    files = {'image_file': (image_path, open(image_path, 'rb'), 'multipart/form-data')}
   payload = {
    'api_key':API_key,
    'api_secret':API_sercret,
    'face_tokens':'587519eb15b08080d99a17a4bb9e0eca',
    'return_attributes':'gender,age,smiling,headpose,facequality,blur,eyestatus,emotion,beauty,mouthstatus,eyegaze,skinstatus',
    'beauty_score_min':0,
    'beauty_score_max':100
    
}

# 6. requests

r_analyze = requests.post(url = base_url, params = payload)

    return r.json()